package com.neudu.glsb.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.neudu.glsb.pojo.UserOperationLogs;
import com.neudu.glsb.service.UserOperationLogsService;
import com.neudu.glsb.mapper.UserOperationLogsMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
public class UserOperationLogsServiceImpl extends ServiceImpl<UserOperationLogsMapper, UserOperationLogs>
        implements UserOperationLogsService {
    private static final Logger logger = LoggerFactory.getLogger(UserOperationLogsServiceImpl.class);

    @Override
    @Transactional
    public List<UserOperationLogs> getLogsByDate(Date startDate, Date endDate) {
        logger.info("开始从数据库查询操作记录，开始日期: {}, 结束日期: {}", startDate, endDate);
        List<UserOperationLogs> logs = this.baseMapper.getLogsByDateWithEmployeeName(startDate, endDate);
        logger.info("从数据库查询操作记录成功，共查询到 {} 条记录", logs.size());
        return logs;
    }
}